class ComponentManager {

    static addComponent(node, component) {
        if(typeof component == 'function'){
            component = new component;
        }
        // var index = _Components.indexOf(null);
        if(!node.helper_components){
            Object.defineProperty(node,"helper_components",{
                value : []
            });
        }
        if(!(component instanceof HelperComponent)){
            return false;
        }
        node.helper_components.push(component);

        // //触发onload事件
        component.onLoad(node);
    }

    static removeComponent(node,component){
        if(!node.helper_components){
            return false;
        }
        var index = node.helper_components.indexOf(component);
        if(index > -1){
            node.helper_components.splice(index,1);
        }
        component.onDelete(node);
    }


}